package com.lzx.service.zlzs.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.lzx.mapper.UserMapper;
import com.lzx.mapper.zlzs.CommodityMapper;
import com.lzx.model.User;
import com.lzx.model.zlzs.Commodity;
import com.lzx.service.UserService;
import com.lzx.service.zlzs.CommodityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.SQLException;
import java.util.List;

@Service("commodityService")
public class CommodityServiceImpl extends ServiceImpl<CommodityMapper,Commodity> implements CommodityService {
    @Autowired
    private CommodityMapper commodityMapper;

    @Override
    public List<Commodity> queryList(Commodity demo){
        return commodityMapper.selectList(new EntityWrapper<Commodity>());
    }

    @Override
    public List<Commodity> selectdemolist( ){
        try {
            return commodityMapper.selectdemolist();
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return null;
    }

    @Override
    public Commodity selectdemobyid(String id){
        try {
            return commodityMapper.selectdemobyid(id);
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return null;
    }

    @Override
    public List<Commodity> selectlistbycountyid(String countyId){
        try {
            return commodityMapper.selectlistbycountyid(countyId);
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return null;
    }
}
